package cn.sfrog.project.biz.admin.controller;

import cn.sfrog.common.core.controller.BaseController;
import cn.sfrog.common.core.page.TableDataInfo;
import cn.sfrog.common.enums.UserTypeEnum;
import cn.sfrog.system.domain.vo.biz.BizCustomerServiceQueryVO;
import cn.sfrog.system.domain.vo.biz.BizCustomerServiceResultVO;
import cn.sfrog.system.service.ISysUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@Api(tags = "管理后台-客服相关")
@RestController
@RequestMapping("/biz/customerService")
public class BizCustomerServiceController extends BaseController {

    @Autowired
    private ISysUserService sysUserService;

    /**
     * 查询列表
     * @param query
     * @return
     */
    @ApiOperation("查询列表")
    @PreAuthorize("@ss.hasPermi('biz:customerService:list')")
    @GetMapping("/list")
    public TableDataInfo list(BizCustomerServiceQueryVO query) {
        query.setUserType(UserTypeEnum.CUSTOMER_SERVICE.getCode());
        startPage();
        List<BizCustomerServiceResultVO> list = sysUserService.selectCustomerServiceUserList(query);
        return getDataTable(list);
    }
}
